This section describes directives that have an effect on symbols and the symbol table.
.globl symbol_name
The .globl directive makes symbol_name external. If symbol_name is otherwise defined (by .set or by appearance as a label), it acts within the assembly exactly as if the .globl statement were not given; however, the link editor may be used to combine this object module with other modules referring to this symbol.
.globl abs
.set abs,1
.globl var
var: .long 2
.indirect_symbol symbol_name
The .indirect_symbol directive creates an indirect symbol with symbol_name and associates the current location with the indirect symbol. An indirect symbol must be defined immediately before each item in a symbol_stub, lazy_symbol_pointers, and non_lazy_symbol_pointers section. The static and dynamic linkers use symbol_name to identify the symbol associated with the following item.
.reference symbol_name
The .reference directive causes symbol_name to be an undefined symbol that will be present in the output's symbol table. This is useful in referencing a symbol without generating any bytes to do it (used, for example, by the Objective C run-time system to reference superclass objects).
.reference .objc_class_name_Object
.private_extern symbol_name
The .private_extern directive makes symbol_name a private external symbol. When the link editor combines this module with other modules (and the - keep_private_externs command-line option is not specified) the symbol turns it from global to static .
.lazy_reference symbol_name
The .reference directive causes symbol_name to be a lazy undefined symbol that will be present in the output's symbol table. This is useful in referencing a symbol without generating any bytes to do it (used, for example, by the Objective C run-time system with the dynamic linker to reference superclass objects but to allow the runtime to bind them on first use).
.lazy_reference .objc_class_name_Object
.stabs n_name ,n_type ,n_other ,n_desc ,n_value
.stabn n_type ,n_other ,n_desc ,n_value
.stabd n_type ,n_other ,n_desc
These three directives are used to place symbols in the symbol table for the symbolic debugger (a "stab" is a symbol table entry).
In each case, the n_type field is assumed to contain a 4.3BSD-like value for the N_TYPE bits. For .stabs and .stabn the n_sect field of the Mach-O file's nlist is set to the section number of the symbol for the specified n_value parameter. For .stabd the n_sect field is set to the current section number for the location counter. The nlist structure is defined in mach-o/nlist.h .
The n_other field of a stab directive is ignored.
.stabs "hello.c",100,0,0,Ltext
.stabn 192,0,0,LBB2
.stabd 68,0,15
.desc symbol_name ,absolute_expression
The .desc directive sets the n_desc field of the specified symbol to absolute_expression .
.desc _main,0xface
.set symbol_name ,absolute_expression
The .set directive creates the symbol symbol_name and sets its value to absolute_expression . This is the same as using symbol_name =absolute_expression .
.set one,1
two = 2
.lsym symbol_name ,expression
A unique and otherwise unreferenceable symbol of the ( symbol_name , expression ) pair is created in the symbol table. Some Fortran 77 compilers use this mechanism to communicate with the debugger.